package com.jhgsys.internal.hazard.service;

import com.jhgsys.internal.common.exception.FebsException;
import com.jhgsys.internal.hazard.dto.HazardReportDto;
import com.jhgsys.internal.hazard.entity.HazardReport;
import com.jhgsys.internal.common.entity.QueryRequest;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jhgsys.internal.system.entity.User;

import java.util.List;
import java.util.Map;

/**
 * 隐患上报 Service接口
 *
 * @author wanghw
 * @date 2024-08-20 09:23:04
 */
public interface IHazardReportService extends IService<HazardReport> {
    /**
     * 查询（分页）
     * @author wanghw
     * @date 2024-08-20 09:23:04
     * @param request QueryRequest
     * @param hazardReport hazardReport
     * @return IPage<HazardReport>
     */
    IPage<HazardReportDto> findHazardReportPage(QueryRequest request, HazardReportDto hazardReport);

    /**
     * 查询（所有）
     * @author wanghw
     * @date 2024-08-20 09:23:04
     * @param hazardReport hazardReport
     * @return List<HazardReport>
     */
    List<HazardReport> findHazardReportList(HazardReport hazardReport);

    /**
    * 根据ID查询
    * @author wanghw
    * @date 2024-08-20 09:23:04
    * @param id
    * @return HazardReport
    */
    HazardReportDto findHazardReportById(String id);

    /**
     * 新增
     * @author wanghw
     * @date 2024-08-20 09:23:04
     * @param hazardReport hazardReport
     */
    void createHazardReport(HazardReportDto hazardReport);

    /**
     * 修改
     * @author wanghw
     * @date 2024-08-20 09:23:04
     * @param hazardReport hazardReport
     */
    void updateHazardReport(HazardReportDto hazardReport);

    /**
     * 逻辑删除
     * @author wanghw
     * @date 2024-08-20 09:23:04
     * @param hazardReport hazardReport
     * @param hazardReportIds hazardReportIds
     */
    void deleteHazardReport(HazardReport hazardReport,String hazardReportIds);

    /**
    * 物理删除
    * @author wanghw
    * @date 2024-08-20 09:23:04
    * @param hazardReportIds hazardReportIds
    */
    void physicallyDeleteHazardReport(String hazardReportIds);

    String createHazardReportNo(String tenantId,String deptId);


    void submitHazardReport(HazardReport hazardReport,String hazardReportId);

    /**
     * 新增整改计划
     * @author wanghw
     * @date 2024-08-20 09:23:12
     * @param hazardReport
     */
    void createHazardReportPlanRecord(HazardReportDto hazardReport, User updateUser,String originStatus);


    /**
     * 整改反馈完成，提交审核
     * @author wanghw
     * @date 2024-08-20 09:23:12
     * @param hazardReport
     */
    void submitHazardReportRectificationRecord(HazardReportDto hazardReport, User updateUser);


    void forwardToHazardReportRectificationRecord(HazardReportDto hazardReport, User updateUser);
    void auditForwardToHazardReport(HazardReportDto hazardReport, User updateUser);



    /**
     * 保存整改反馈信息
     * @author wanghw
     * @date 2024-08-20 09:23:12
     * @param hazardReport
     */
    void saveHazardReportRectificationRecord(HazardReportDto hazardReport, User updateUser);



    void saveHazardReportAuditRecord(HazardReportDto hazardReport, User updateUser);


    void saveHazardReportAppealRecord(HazardReportDto hazardReport) throws FebsException;


    void deleteHazardReportRecord(HazardReportDto hazardReport);


    void redoHazardReportRecord(String id);

    int countTodayByUserName(String userName);


    Map<String, Object> countYearByUserName(String userName);
}
